#!/bin/bash

#------------------------------------------------------------------------------
#Filename:	74710-named.sh
#Version:	1.1
#Date:	        2013/07/11
#Author:	yuanhui.shi
#Email:	        yuanhui.shi@cs2c.com.cn
#Summary:	02.01系统核心功能-01文件系统-01文件命名-01验证文件名所能使用的字符符合linux命名规范
#Notes:	        测试linux命名规范
#Copyright:	China Standard Software Co.,Ltd.
#History:
#	        Version 1.0,2013/07/11
#	        -The first one
#	        Version 1.1,2013/09/03
#	        -Modify the script to satisfy the shell standard
#------------------------------------------------------------------------------


PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

source ../../lib/Echo.sh

function CleanData ()
{
 rm -rf ${TMPDIR}
 EchoInfo "74710-named.sh执行完毕"
}

trap "CleanData" EXIT

TMPDIR=/tmp/test$$
mkdir ${TMPDIR}
touch "${TMPDIR}/test for filename" && test -f "${TMPDIR}/test for filename"
EchoResult "新建 'test for filename' 文件成功" 

touch "${TMPDIR}/!@#$%^&" && test -f "${TMPDIR}/!@#$%^&"
EchoResult "新建 '!@#$%^&' 文件成功" 

touch "${TMPDIR}/."
! test -f "${TMPDIR}/."
EchoResult "touch file . failed"

touch "${TMPDIR}//gegdgd"
! ls ${TMPDIR} | grep '/gegdgd'
EchoResult "touch file ${TMPDIR}//gegdgd failed"
